package com.tbit.uqbike.client.handler;

import com.tbit.uqbike.client.common.ResultCode;
import com.tbit.uqbike.client.common.ResultMsg;
import com.tbit.uqbike.client.handler.borrowbikehandler.AbstractCheckHandler;
import com.tbit.uqbike.client.vo.borrow.BorrowBikeVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author lh2
 * @ClassName: CheckClient
 * @Description: 组装校验链的客户端
 * @date 2023-07-26 03:51:06
 */
@Slf4j
@Component
public class CheckClient {
    public ResultMsg executeChain(AbstractCheckHandler handler, BorrowBikeVO vo, String serialNO) {
        ResultMsg result = handler.handle(vo, serialNO);
        if (result.getCode() != ResultCode.SUCCESS.getCode()) {
            return result;
        }
        return result;
    }
}
